1. Field of the Invention
The present invention relates to an error detection method and an error detection apparatus for detecting errors in a communication controller in each node when a plurality of nodes on a transmission line communicate with each other, and to a network system provided with the error detection apparatuses.
2. Description of the Related Art
Conventionally, a vehicle network system has been used on a vehicle. This vehicle, network system is composed of a plurality of nodes connected, for example, in a ring form. Each node on this network sends and receives data to or from other nodes over the transmission line.
Each node on this vehicle network system has a communication integrated circuit (communication IC, for short) which acts as a communication controller controlling data transmission and reception. FIG. 1 is a diagram showing a communication IC, provided in a conventional node, and its peripheral circuits.
Referring to FIG. 1, each node comprises a communication IC 101, a digital signal processor 107, a source data unit 109, and a controller 111 controlling all these components.
The communication IC 101 comprises a router 103 which has the routing function. When data received from an upstream network 105a is addressed to this node, the communication IC 101 captures it into the digital signal processor 107 via paths 103a and 103b; when the data is not addressed to this node, the communication IC 101 sends it to a downstream network 105b via paths 103a and 103d. 
When the source data unit 109 has data to be sent, the communication IC 101 receives the data from the source data unit 109 and sends it to the downstream network 105b via paths 103c and 103d. 
FIG. 2 is a diagram illustrating how routing is performed by the conventional communication IC. Referring to FIG. 2, when a frame composed of a header and four data items (Ch1 data A, Ch2 data B, Ch3 data C, and Ch4 data D, all in 16 bits) is sent from the upstream network 105a, the router 103 gets desired data, which is Ch2 data B, from the frame and stores it as source data OUT.
When there is data to be sent from the node, the router 103 adds data E, which source data IN to be sent, to the Ch2 data area of the frame and sends the frame to the downstream network 105b. 
However, in the conventional system, the communication IC 101 sends source data to the downstream network 105b without making a data check. This sometimes results in problems. For example, when the communication IC performing real-time transfer of digital audio data enters the routing operation error state due to an initialization error or some other errors, incorrect source data, such as out-of-synchronization data, is generated during routing operation and is sent to the network. This out-of-synchronization data prevents communication from being performed correctly.
In addition, when the communication IC receives data from the network while it is in the routing operation error state, it captures out-of-synchronization data. For example, in FIG. 2, although the communication IC should capture data composed only of 16-bit Ch2 data B, it captures incorrect data composed of part of Ch2 data B. preceded by the trailing part of Ch1 data A.
It is an object of the present invention to provide an error detection method and an error detection apparatus which increase network reliability by detecting communication IC errors and to provide a network system provided with the error detection apparatuses.
To achieve the above object, according to an aspect of the present invention, there is provided an error detection apparatus for detecting an error in a communication controller which, in a normal operation mode, receives a data frame from an upstream of a transmission line via a first input terminal, outputs data via a first output terminal if the data frame contains the data addressed to this node, and adds source data to the data frame and outputs the data frame to a downstream of the transmission line via a second output terminal if the source data to be sent to the downstream of the transmission line is received via a second input terminal and which, in a test mode activated when a control signal indicating the test mode is received, outputs data received via the second input terminal to the first output terminal, the error detection apparatus comprising: a test data unit which, in the test mode, sends test data to the second input terminal of the communication controller; and an error detection unit which, in the test mode, receives the test data output from the test data unit and output data output from the first output terminal of the communication controller and checks the communication controller for errors based on the test data and the output data.
According to the present invention, the test data unit sends test data, which is used in testing the communication controller for errors, to the second input terminal, and the error detection unit detects errors in the communication controller based on the output data output from the communication controller in response to the test data and on the test data output from the test data unit. This makes it possible to easily detect errors, such as routing operation errors, of the communication controller, thus increasing network reliability.
In a preferred embodiment of the present invention, the error detection unit determines that the communication controller is normal when the test data and the output data match and that the communication controller is abnormal when the test data and the output data do not match.
In a preferred embodiment of the present invention, the error detection apparatus further comprises: a first switching unit which connects a source data unit storing the source data therein to the second input terminal in the normal operation mode and which connects the test data unit to the second input terminal in the test mode; and a second switching unit which connects the first output terminal to a processing unit processing the data addressed to the node in the normal operation mode and which connects the first output terminal to the error detection unit in the test mode.
To achieve the above object, according to another aspect of the present invention, there is provided an error detection method for detecting an error in a communication controller which, in a normal operation mode, receives a data frame from an upstream of a transmission line via a first input terminal, outputs data via a first output terminal if the data frame contains the data addressed to this node, and adds source data to the data frame and outputs the data frame to a downstream of the transmission line via a second output terminal if the source data to be sent to the downstream of the transmission line is received via a second input terminal and which, in a test mode activated when a control signal indicating the test mode is received, outputs data received via the second input terminal to the first output terminal, the error detection method comprising the steps of: in the test mode, sending test data to the second input terminal of the communication controller; and checking the communication controller for errors based on output data output from the first output terminal of the communication controller and the test data.
In a preferred embodiment of the present invention, the communication controller is determined to be normal when the test data and the output data match and wherein the communication controller is determined to be abnormal when the test data and the output data do not match.
In a preferred embodiment of the present invention, in the normal operation mode, a source data unit storing the source data therein is connected to the second input terminal and the first output terminal is connected to a processing unit processing the data addressed to the node; and in the test mode, the test data unit is connected to the second input terminal and the first output terminal is connected to the error detection unit.
To achieve the above object, according to still another aspect of the present invention, there is provided a network system comprising a plurality of nodes connected via a transmission line in a ring form, each node comprising: a communication controller which, in a normal operation mode, receives a data frame from an upstream of the transmission line via a first input terminal, outputs data via a first output terminal if the data frame contains the data addressed to this node, and adds source data to the data frame and outputs the data frame to a downstream of the transmission line via a second output terminal if the source data to be sent to the downstream of the transmission line is received via a second input terminal and which, in a test mode activated when a control signal indicating the test mode is received, outputs data received via the second input terminal to the first output terminal; and an error detection apparatus for detecting an error in the communication controller, the error detection apparatus comprising: a test data unit which, in the test mode, sends test data to the second input terminal of the communication controller; and an error detection unit which, in the test mode, receives the test data output from the test data unit and output data output from the first output terminal of the communication controller and checks the communication controller for errors based on the test data and the output data.
According to the present invention, in the error detection apparatus provided in each node, the test data unit sends test data, which is used in testing the communication controller for errors, to the second input terminal, and the error detection unit detects errors in the communication controller based on the output data output from the communication controller in response to the test data and on the test data output from the test data unit. This makes it possible to easily detect errors, such as routing operation errors, of the communication controller, thus increasing network reliability.
The nature, principle and utility of the invention will become more apparent from the following detailed description when read in conjunction with the accompanying drawings.